<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<form id="classinfo" enctype="multipart/form-data" onsubmit="return false">
                <div class="panel-body">
						<div class="row form-group">
							<label class="col-sm-3 control-label" style="font-size:19px;font-weight:normal;padding-left: 50px;padding-top: 8px;">班级名:</label>
							<div class="col-sm-8">
								<input type="text" name="className" id="name" class="form-control input-lg">
							</div>
						</div>
{#                       <div class="row form-group">#}
{#							<label class="col-sm-3 control-label" style="font-size:19px;font-weight:normal;padding-left: 50px;padding-top: 8px;">课程名称:</label>#}
{#							<div class="col-sm-8">#}
{#								<input type="text" name="motto" id="motto" class="form-control input-lg" placeholder="个性签名" value="{{person1.Motto}}">#}
{#							</div>#}
{#						</div>#}
                        <div class="row form-group">
							<label class="col-sm-3 control-label" style="font-size:19px; font-weight:normal;padding-left: 50px;padding-top: 8px;">
                            人数:
                            </label>
							<div class="col-sm-8">
								<input type="text" name="num" id="age" class="form-control input-lg">
							</div>
						</div>


					</div>
                <div class="modal-footer">
                    <button type="button" class="btn btn-default" data-dismiss="modal">关闭
                    </button>
                    <button type="submit" class="btn btn-primary" id="sub2">
                        提交更改
                    </button>
                </div>
            </form>
		</div><!-- /.modal-content -->
	</div><!-- /.modal -->
</div>
<script>
                    $('#sub2').click(function () {
                        var Data = $("#classinfo").serialize();
                        $.ajax({
                            url: '/service/classadd/',
                            type: 'POST',
                            data: Data,
                            success: function (response) {
                                if(response['status'] == 200){
                                    alert("创建成功");
                                    location.href = '/service/myhome/'
                                }
                                else if (response['status'] == 201){
                                    alert("您已有课程");
                                    location.href = '/service/myhome/'
                                }
                                else{
                                    alert("创建失败");
                                    }
                                }
                        })
                    })
                </script>

</body>
</html>